Skip to content

[flink] Fix Flink version detection for key-only deletes on non-release versions - #9053

Merged
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/flink2-version-detection-key-only-deletes
Aug 6, 2026
Merged

[flink] Fix Flink version detection for key-only deletes on non-release versions#9053
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/flink2-version-detection-key-only-deletes

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9052

  • ChangelogModeUtils.isFlink21OrAbove() split EnvironmentInformation.getVersion() on . only, leaving 2-SNAPSHOT as the minor part. The NumberFormatException was swallowed, so key-only deletes were disabled on a runtime that has the FLIP-510 API, while the log claimed requires Flink 2.1+ (current version: 2.2-SNAPSHOT).
  • This hits Flink built from a release branch or master: the ASF snapshot repository publishes flink-runtime as 2.1-SNAPSHOT and 2.2-SNAPSHOT. Released 2.1.0 was never affected.
  • Split on . and - instead. One-directional: 2.0-SNAPSHOT, 2.0-rc1, 2.0-vvr-11.2-SNAPSHOT still return false, keeping the Flink 2.0 NoSuchMethodError guard.
  • E2eTestBase.safelyParseVersion() already acknowledges suffixed Flink versions.

Tests

  • Added ChangelogModeUtilsTest#testVersionAtLeast21 / #testVersionBelow21.
  • mvn -pl paimon-flink/paimon-flink2-common -Pflink2 clean install — 18 tests passed.

…se versions

Flink builds from a release branch or master publish a two-component
version plus a suffix (e.g. 2.1-SNAPSHOT, 2.2-SNAPSHOT), so splitting
only on '.' left "2-SNAPSHOT" as the minor part. The NumberFormatException
was swallowed and key-only deletes were silently disabled on runtimes that
do have the FLIP-510 API.

Split on both '.' and '-', and extract the parsing into a package-private
isVersionAtLeast21(String) so it can be unit tested. Strings that resolve
to Flink 2.0 or below still return false, keeping the NoSuchMethodError
guard intact.

Generated-by: Claude Code
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 0e288a8 into apache:master Aug 6, 2026
12 checks passed
@thswlsqls
thswlsqls deleted the fix/flink2-version-detection-key-only-deletes branch August 6, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Key-only deletes silently disabled on Flink versions without a patch component

2 participants